package com.cragon.service;

import com.cragon.dao.LoginDao;
import com.cragon.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: TODO
 * @Author: ZHOUHAILONG
 * @Date: 2020年09月14日 14:41
 */
@Service
public class LoginService {
    @Autowired
    private LoginDao loginDao;

    public boolean verifyLogin(User user) {
        List<User> userList = loginDao.findByUsernameAndPassword(user.getUsername(), user.getPassword());
        return userList.size() > 0;
    }
}
